updating oE compare

compare

include map.e 
namespace map 
public function compare(map map_1_p, map map_2_p, integer scope_p = 'd') 

compares two maps to test equality.

Parameters:
  1. map_1_p : A map
  2. map_2_p : A map
  3. scope_p : An integer that specifies what to compare.
    • 'k' or 'K' to only compare keys.
    • 'v' or 'V' to only compare values.
    • 'd' or 'D' to compare both keys and values. This is the default.
Returns:

An integer,

  • -1 if they are not equal.
  • 0 if they are literally the same map.
  • 1 if they contain the same keys and/or values.
Example 1:
map map_1_p = foo() 
map map_2_p = bar() 
if compare(map_1_p, map_2_p, 'k') >= 0 then 
     ... -- two maps have the same keys 
Not Categorized, Please Help

Search



Quick Links

User menu

Not signed in.

Misc Menu